Skip to content

Add generic F407Vx/F417Vx pinout variant #937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2020

Conversation

MCUdude
Copy link
Contributor

@MCUdude MCUdude commented Feb 13, 2020

Pinout is based on the F446Rx pinout, but with different peripheral mapping and extra IOs.

Pinout is based on the F446Rx pinout, but with different peripheral mapping and extra IOs
@MCUdude
Copy link
Contributor Author

MCUdude commented Feb 13, 2020

@fpistm I see now that the F405/415V, F407/417V and F427/437V are very similar. So similar that I think they could share the same pinout variant!

Here's the difference (found from diffing their PeripheralPins.c files):

  • F405/415V lacks a few pins on port E + ethernet support
  • F407/417V lacks a few pins on port E
  • F427/437V has all of this

I think this should be able to take into account by adding some ifdefs in the periperalPins.c file.
If you're OK with this, what should this pinout variant be called? Generic_4xxVx isn't very descriptive either.

@MCUdude
Copy link
Contributor Author

MCUdude commented Feb 13, 2020

After playing around with CubeMX, it seems like the F427/437 can run at 180 MHz (the others at 168 MHz), plus the F427/437 also have slightly different clock setup settings.

@fpistm
Copy link
Member

fpistm commented Feb 13, 2020

After playing around with CubeMX, it seems like the F427/437 can run at 180 MHz (the others at 168 MHz), plus the F427/437 also have slightly different clock setup settings.

Well what about the STM32F401V which exist and have less pins...
Ideally Generic_4x[5-7]Vx could be better I guess but I would avoid using special char.
Maybe Generic_4x5-7Vx is more explicit?

@MCUdude
Copy link
Contributor Author

MCUdude commented Feb 13, 2020

Well what about the STM32F401V which exist and have less pins...

It's also about on what pins the peripherals are routed to. I'll see what I can do. I guess I can use
#ifdef STM32F405xx, #ifdef STM32F415xx, #ifdef STM32F407xx, #ifdef STM32F417xx, #ifdef STM32F427xx and #ifdef STM32F437xx, to separate them where needed?
Atleast that's what's done here:

#ifdef STM32F103xE
// {PA_0, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC3_IN0
#endif
{PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1
// {PA_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC2_IN1
#ifdef STM32F103xE
// {PA_1, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC3_IN1

Maybe Generic_4x5-7Vx is more explicit?

Sounds good to me!

@fpistm
Copy link
Member

fpistm commented Feb 13, 2020

Well, up to you sometimes it is too much hard to read if too many define.

FYI, I have reworked src tree of the generated files to ease access.
https://github.com/stm32duino/Arduino_Tools/tree/master/src/genpinmap/Arduino

I'm also thinking about reorder variants/ folder in the core because they are more and more variants.
variants/<menu id>/<variant name>

ex:

GenF4/Generic_F412Cx
     /Generic_F412Rx
     /... 

But I don't know if I can achieve this due to Arduino specification...

@MCUdude
Copy link
Contributor Author

MCUdude commented Feb 13, 2020

FYI, I have rework src tree of the generated files to ease access.
https://github.com/stm32duino/Arduino_Tools/tree/master/src/genpinmap/Arduino

I've been using this for at least a month now 😉 Would be difficult to do what I do without it.

OK, I see now that F429/F439 and F469/479 are also similar. Maybe I should divide this up. Especially if you're planning to group variants into folders. How about:

Generic_F4x5RG
Generic_F4x7Rx
Generic_F4x9Rx
?
This will make it easier to maintain.

@fpistm
Copy link
Member

fpistm commented Feb 13, 2020

Especially if you're planning to group variants

This should not change the "problem".
About the group, it should not be so easy due to Arduino specification:

{build.variant.path} - The path to the selected board variant folder
(for example hardware/arduino/avr/variants/micro)

@MCUdude
Copy link
Contributor Author

MCUdude commented Feb 13, 2020

But from my point of view, it is certainly easier if we have three separate variants instead of one giant one. If you agree with this, this PR is already ready to be merged.

@uzi18
Copy link

uzi18 commented Feb 13, 2020

@MCUdude will you add also F407Zx with more pins available?

@MCUdude
Copy link
Contributor Author

MCUdude commented Feb 13, 2020

@uzi18 maybe later

@fpistm
Copy link
Member

fpistm commented Feb 13, 2020

Agreed.
After a quick test, as I thought, it will not be possible to change variants/ folder structure.
Arduino automatically include all sources files from the specified {build.variant} and it will be too risky to change it.

@fpistm fpistm self-requested a review February 13, 2020 16:23
@fpistm fpistm added the new variant Add support of new bard label Feb 13, 2020
@fpistm fpistm added this to the 1.9.0 milestone Feb 13, 2020
Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fpistm fpistm merged commit 489e74a into stm32duino:master Feb 13, 2020
@stas2z
Copy link
Contributor

stas2z commented Feb 14, 2020

AFAIK upload.maximum_data_size=196608 is wrong here
these chips have 128K RAM + 64K CCM so it will not work imo

@stas2z
Copy link
Contributor

stas2z commented Feb 15, 2020

AFAIK upload.maximum_data_size=196608 is wrong here
these chips have 128K RAM + 64K CCM so it will not work imo

yep, just checked, it stuck after uploading
ive checked one of my cube projects and found this one

/* Memories definition */
MEMORY
{
  CCMRAM	(xrw)	: ORIGIN = 0x10000000,	LENGTH = 64K
  RAM	(xrw)	: ORIGIN = 0x20000000,	LENGTH = 128K
  FLASH	(rx)	: ORIGIN = 0x8000000,	LENGTH = 1024K
}

so additional 64K CCM block is not after main 128K block

@BennehBoy
Copy link
Contributor

I think both the PRNTR board variants also make this mistake of including CCMRAM in data size. But I guess that needs a separate issue raising.

@fpistm
Copy link
Member

fpistm commented Feb 15, 2020

You're right @stas2z
I didn't generate the LD script to check. 😕
Seems @MCUdude use the same for all. It will require to check all GenF4 added.
Thanks for pointing this 👍

@MCUdude
Copy link
Contributor Author

MCUdude commented Feb 15, 2020

Sorry about this. I checked the other variants I've added recently, and they do not have CCM, only this target.

@fpistm
Copy link
Member

fpistm commented Feb 15, 2020

No worries.
I should have seen it 😖

@fpistm fpistm mentioned this pull request Feb 17, 2020
Bmooij pushed a commit to Bmooij/Arduino_Core_STM32 that referenced this pull request Jul 14, 2020
Pinout is based on the F446Rx pinout, but with different peripheral mapping and extra IOs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new variant Add support of new bard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants